package cn.gzsf.csmall.product.ex;

import cn.gzsf.csmall.product.web.ServiceCode;
import lombok.Data;

/**
 * 业务异常，专门定义不符合业务的各种错误
 */
@Data
public class ServiceException extends RuntimeException{

    private ServiceCode serviceCode;

    public ServiceException() {
    }

    public ServiceException(String message) {
        super(message);
    }

    //让调用者指定状态码和状态描述
    public ServiceException(ServiceCode serviceCode,String message) {
        super(message);
        this.serviceCode = serviceCode;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    public ServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
